package com.qfjy.homework.jianghui;

/**
 * @author : jianghui
 * @version : 1.0
 * @date : 2022/11/10 19:29
 */
public class ProxyImage implements Image {

    private RealImage realImage;
    private String fileName;

    public ProxyImage(String fileName) {
        this.fileName = fileName;
    }

    @Override
    public void display() {
        if(realImage == null){
            realImage = new RealImage(fileName);
        }
        realImage.display();
    }
}
